from openpyxl import load_workbook
import xlrd
class excel():
    def __init__(self,filepath,shenname):
        self.filepath=load_workbook(filepath)
        self.shenname=self.filepath[shenname]


    def getdata(self):
        datalist=[]
        for i in self.shenname:
            tmp_list=[]
            tmp_list.append(i[0].value)
            tmp_list.append(i[1].value)
            # tmp_list.append(i[2].value)
            datalist.append(tmp_list)
        datalist.pop(0)
        return datalist


if __name__ == '__main__':
    filepath=r"C:\Users\24108\PycharmProjects\pythonProject9\day9\新建 Microsoft Excel 工作表.xlsx"
    sheetname='Sheet1'
    dy=excel(filepath,sheetname)
    print(dy.getdata())